var nameArray = new Array();
var nameArray2 = new Array();
function transferAllToForm(name) {
	if (name == "employee") {
		temp = "";
		document.getElementById("birthdayOfCondition").Value = temp.concat(
				document.getElementById("birthDayYearOfCondition").Value).concat(
				"-").concat(
				document.getElementById("birthDayMonthOfCondition").Value).concat(
				"-").concat(
				document.getElementById("birthDayDateOfCondition").Value);
		document.getElementById("beginWorkDayOfCondition").Value =temp.concat(
				document.getElementById("beginWorkYearOfCondition").Value).concat(
				"-").concat(
				document.getElementById("beginWorkMonthOfCondition").Value).concat(
				"-").concat(
				document.getElementById("beginWorkDateOfCondition").Value);
		nameArray[0] = "name";
		nameArray2[0] = "nameOfCondition";
		nameArray[1] = "sex";
		nameArray2[1] = "sexOfCondition";
		nameArray[2] = "birthplace";
		nameArray2[2] = "birthPlaceOfCondition";
		nameArray[3] = "isMarry";
		nameArray2[3] = "isMarriedOfCondition";
		nameArray[4] = "position";
		nameArray2[4] = "positionOfCondition";
		nameArray[5] = "birthday";
		nameArray2[5] = "birthdayOfCondition";
		  nameArray[6]="beginWorkDay"; nameArray2[6]="beginWorkDayOfCondition";
	}
	for (i = 0; i <nameArray.length; i++) {
		document.getElementById(nameArray[i]).value = document
				.getElementById(nameArray2[i]).value;
	}
	document.form1.submit();

}
function getYears(obj) {
	var ddd = new Date();
	yearObj = document.getElementById(obj);
	for (i = 1; i < 21; i++) {
		var y = document.createElement('option');
		y.text = ddd.getYear() + 1900 - i;
		y.value = ddd.getYear() + 1900 - i;
		document.getElementById(obj).appendChild(y);
	}
}
function getDays(yearobj, monthobj, daysobj) {

	yearObj = document.getElementById(yearobj);
	index = yearObj.selectedIndex;
	var year = yearObj.options[index].value;
	monthObj = document.getElementById(monthobj);
	var month = monthObj.value;
	renNian = (year / 100) + (year / 400) + (year / 4);
	days = 0;

	switch (month) {
	case "2":
		if (renNian > 0)
			days = 28;
		break;

	case "1":
		days = 31;
		break;
	case "3":
		days = 31;
		break;
	case "5":
		days = 31;
		break;
	case "7":
		days = 31;
		break;
	case "8":
		days = 31;
		break;
	case "10":
		days = 31;
		break;
	case "12":
		days = 31;
		break;

	case "2":
		days = 30;
		break;
	case "4":
		days = 30;
		break;
	case "6":
		days = 30;
		break;
	case "11":
		days = 30;
		break;
	}
	for (i = 1; i < days + 1; i++) {
		var y = document.createElement('option');
		y.text = i;
		y.value = i;
		document.getElementById(daysobj).appendChild(y);
	}

}